pp108 : Defining a Managed Component in an Application Connector

Defining a Managed Component in an Application Connector

This topic describes the procedure to define a managed component in an application connector.


A generic Application Connector has a managed component associated with it. Application connector developers can use this managed component to define counters, settings and so on. You can also add sub-components to it.
You can add counters, settings and so on, to a specific application connector by overwriting the Web service operation createManagedComponent() as shown below:

/**
 * Create a managed component for this application connector,
 * using the processor as parent component.
 */
protected IManagedComponent createManagedComponent()
{
	IManagedComponent mc = super.createManagedComponent();
	timeoutCounter = (ITimerEventValueCounter) mc.createPerformanceCounter("timeouts",Messages.REQUEST_TIMEOUT_DESC,CounterFactory.TIMER_EVENT_VALUE_COUNTER);
	return mc;
}


The service initially calls the createManagedComponent() Web service operation and then calls the open() Web service operation of the application connector. So the counters and settings can be defined in createManagedComponent() after the creation of the managed component using super.createManagedComponent() or in the open() Web service operation of the application connector.
When an application connector adds such elements to the managed component defined in the base class, it must also overwrite the getManagedComponentType() Web service operation and return a specific type. This is necessary because, by convention, a managed component type has a fixed set of counters, settings, sub-components and so on. It is also useful to overwrite the getManagementDescription() and getManagementName() Web service operations to give useful descriptions for this specific application connector.

Overwriting the getManagedComponentType() Web service operation

/**
 * Returns the type of this managed component.
 *
 * @return the type of this application connector.
 */
protected String getManagedComponentType()
{
	return "RequestMonitor";
}

/**
 * Returns the name of this application connector,
 * suitable for usage in a management tool.
 *
 * @return the name of this application connector,
 * suitable for usage in a management tool.
 */
protected String getManagementName()
{
	return "Request monitor";
}

/**
 * Returns the description of this application connector,
 * suitable for usage in a management tool.
 *
 * @return the name of this application connector,
 * suitable for usage in a management tool.
 */
protected String getManagementDescription()
{
	return Messages.REQUEST_MONITOR_CONNECTOR_DESCRIPTION;
}